<!-- 变更历史记录-->
<template>
	<view class="pageMain u-skeleton">
		<view class="topBox px-3" :style="{ paddingTop: statusBarHeight }">
			<view class="nav d-flex px-4 a-center font-lg text-light" :style="{ height: navBarHeight }"></view>
			<view class="logoBox text-main font-md iconfont icon-back" @click="backFn"></view>
			<view class="logoBox ">
				<view class="d-flex a-center j-sb">
					<view class="font text-h">发布时间：{{ formData.createDateTime }}</view>
					<view class="bg-blue rounded  px-2 py-1 font text-blue">{{ formData.acceptStatusName }}</view>
				</view>
				<view class="font-lg text-main font-weight pb-1">{{ formData.projectName }}</view>
				<view class="u-flex u-row-between pb-1">
					<view class="bg-grey  px-1 py text-primary font">{{ formData.rootInformationEnumName }}</view>
					<view class="text-primary font">
						<image
							class="imagesBox"
							mode="aspectFit"
							style="width: 46rpx ; height: 16rpx;"
							:src="getStaticFilePath('ico-jd.png')"
						></image>
						{{ formData.projectStageName }}
					</view>
				</view>

				<view class="projectBox  rounded-8  line-h-md">
					<view class="d-flex mt-2 a-center">
						<view class="iconfont icon-calendar-todo-fill text-primary"></view>
						<view class="font pl-1 text-677FA0">{{ formData.projectAddressName }}</view>
					</view>
				</view>
			</view>
		</view>

		<view class="d-flex j-sb pt-3 px-3 a-center ">
			<view class=" font-md text-main font-weight">变更记录</view>
		</view>
		<z-paging ref="paging" v-model="dataList" use-page-scroll empty-view-text="暂无数据" @query="queryList">
			<view
				class="projectBox p-3 m-3 rounded-8 bg-write line-h-lg text-l"
				v-for="(item, index) in dataList"
				:key="index"
			>
				<view class="font text-h">
					<text class="text-tips font">变更时间：</text>
					<text class="text-main font ">{{ item.changeTime }}</text>
				</view>
				<view class="font text-h">
					<text class="text-tips font">变更类型：</text>
					<text class="text-main font ">{{ item.changeWayName }}</text>
				</view>
				<view class="font text-h">
					<text class="text-tips font">变更项目：</text>
					<text class="text-error font ">{{ item.changeContent }}</text>
				</view>

				<view class="font text-h">
					<text class="text-tips font">变更前：</text>
					<text class="text-primary font ">{{ item.changeBefore }}</text>
				</view>
				<view class="font text-h">
					<text class="text-tips font">变更后：</text>
					<text class="text-primary font ">{{ item.changeAfter }}</text>
				</view>
			</view>
		</z-paging>
	</view>
</template>

<script>
import { getbusiInfoData, getChangePage } from '@/api/apis.js';
export default {
	data() {
		return {
			statusBarHeight: '',
			navBarHeight: '',
			formData: {},
			busiInfoId: '',
			feedbackPhaseList: [],
			dataList: []
		};
	},
	onLoad() {
		if (this.$Route.query.busiInfoId) {
			this.getbusiInfoDataFn(this.$Route.query.busiInfoId);
		}
		/*#ifdef MP*/
		let that = this;
		uni.getSystemInfo({
			success: function(info) {
				// 屏幕高度
				let screenHeight = info.screenHeight;
				// 屏幕宽度
				let screenWidth = info.screenWidth;
				// 胶囊高度
				//状态栏高度
				that.statusBarHeight = info.statusBarHeight * 2 + 'rpx';
				let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
				let navBarHeight = menuButtonInfo.bottom + menuButtonInfo.top - screenHeight;
				that.navBarHeight = navBarHeight + screenHeight - info.statusBarHeight + 'rpx';
			}
		});
		/*#endif*/
	},
	methods: {
		//获取项目详情
		getbusiInfoDataFn(id) {
			getbusiInfoData({
				busiInfoId: id
			}).then(res => {
				if (res.code == 10000) {
					this.formData = res.data;
				} else {
					this.$u.toast(res.msg);
				}
			});
		},
		// 获取变更历史
		queryList(pageNo, pageSize) {
			getChangePage({
				page: pageNo,
				size: pageSize,
				busiInfoId: this.$Route.query.busiInfoId
			}).then(res => {
				if (res.code == 10000) {
					this.$refs.paging.complete(res.data.data);
				} else {
					this.$refs.paging.complete(false);
				}
			});
		},

		//查看历史记录详情
		auditHistoryDetailsFn(busiHistoryId) {
			this.$Router.push({
				path: '/detailPages/pages/projectDetailsChangeHistoryDetails/index',
				query: {
					busiHistoryId: busiHistoryId
				}
			});
		},
		backFn() {
			this.$Router.back();
		}
	}
};
</script>

<style lang="scss" scoped>
.pageMain {
	width: 100%;
	height: 100%;
	.topBox {
		background: linear-gradient(180deg, rgba(45, 143, 255, 0.4), rgba(190, 214, 250, 0) 100%);
		background-repeat: no-repeat;
		background-size: 100% 100%;
		.logoBox {
			padding-top: 40rpx;
		}
	}
	.lable60 {
		width: 120rpx;
	}
	.text-container {
		white-space: pre-line; /* 保留换行符并转换为换行 */
	}
}
</style>
